<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ include file="/jsp/common/common.jsp"%>  

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title></title>
		<meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">
		<link rel="stylesheet" type="text/css"
    href="<c:url value="/static/jquery-easyui/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css"
    href="<c:url value="/static/jquery-easyui/themes/icon.css"/>">
<link rel="Stylesheet" type="text/css"
    href="<c:url value="/static/css/jquery.ui.css"/>" />
<script type="text/javascript"
    src="<c:url value="/static/jquery-easyui/jquery-1.6.min.js"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/jquery-easyui/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/js/showMsg.js"/>"></script>
<script type="text/javascript"
    src="<c:url value="/static/listBox/jquery.clever.listbox.js"/>"></script>
		<script>
			function initList(listDisplayEId) {
				$('#' + listDisplayEId).datagrid(
						{
							url : "<c:url value="/check/findCheckDetail.do"/>"+"?materId="+"${checkVo.materId }"+"&ordDateStart="+"${checkVo.ordDateStart }"+"&ordDateEnd="+"${checkVo.ordDateEnd }"+"&custIdAll="+"${checkVo.custIdAll }"+"&supId="+"${checkVo.supId }" ,
							nowrap : false,
							striped : true,
							collapsible : true,
							remoteSort : true,
							notSelectByRow : false,
							toolbar : [
		                                {
		                                    id : listDisplayEId + '_btn_save',
		                                    text : 'Excel报表导出',
		                                    iconCls : 'icon-print',
		                                    handler : function() {
		                                        excel();
		                                    }
		                                }           
		                            ],
							onLoadError:function(){
								$.messager.alert('错误','获取数据失败，请与管理员联系！','error');
							}
						});
			};
			$(document).ready(function() {
				initList('listDisplay');
			});
			//导出报表
            function excel(){
                $('#searchForm').form('submit',
                        {
                            url:'<c:url value='/check/exportCheckExcelDetail.do'/>', //查询提交路径
                            onSubmit:function()//提交按钮相应函数
                            {
                                return $('#searchForm').form('validate');
                            },
                            success:function(data){
                                data = eval( "("+data+")" );
                                if(data.success){
                                    $.messager.alert("提示", "导出成功！",'info', function(){
                                        window.close();
                                    });
                                }else{
                                    $.messager.alert("提示", data.msg, 'warning');
                                }
                            },
                            error:function(){
                                $.messager.alert("错误", "系统错误，请联系管理员！", 'error');
                                return;
                            }
                        }
                );
            }
    </script>
			</head>
			<body>
			<table width="98%">
			<tr><td>
			<div style="height: auto; width:100%;background: #fafafa; padding: 5px;" class="easyui-panel" title="主页检索条件" iconCls="icon-search" collapsible="true" minimizable="false" maximizable="false" closable="false">
					<form id="searchForm" name="searchForm" method="post">
						<div>
		            	<table cellpadding="5">
								<tr>
									<td>起始日期</td>
									<td><input class="easyui-validatebox" readOnly="true" editable="false" id="ordDateStart" name="ordDateStart" value="${checkVo.ordDateStart }"></input></td>
									<td>截止日期</td>
                                    <td><input class="easyui-validatebox" readOnly="true" editable="false" id="ordDateEnd" name="ordDateEnd" value="${checkVo.ordDateEnd }"></input></td>
                                    <td>材料名：</td>
                                    <td><input class="easyui-validatebox" readOnly="true" id="materName" editable="false" name="materName" value="${checkVo.materName }"></input></td>
                                    <td><input class="easyui-validatebox" readOnly="true" id="materId" editable="false" name="materId" value="${checkVo.materId }" type="hidden"></input></td>
                                </tr>
                                <tr>
                                    <td>客户</td>
                                    <td colspan="3"><input style="width:355px" readOnly="true" id="custName" name="custName" value="${checkVo.custName }"></input></td>
                                    <td>供货商</td>
                                    <td><input readOnly="true" id=supName name="supName" value="${checkVo.supName }"></input></td>
		                    	</tr>
		                    	<input class="easyui-validatebox"  readOnly="true" editable="false" id="custIdAll" name="custIdAll" value="${checkVo.custIdAll }" type="hidden"></input>
                                <input class="easyui-validatebox"  readOnly="true" editable="false" id="supId" name="supId" value="${checkVo.supId }" type="hidden"></input>
		                    	
		                </table>
						</div>
					</form>
				</div>
			</td></tr>
            </table>
			<table width="98%">
		      <tr>
		      <td>
			     <table id="listDisplay" title="货物批量列表" 
				    iconCls="icon-list" singleSelect="false" idField="id"
				    loadMsg="请稍候......"
				    pagination="true" pageSize="10"
				    pageList="[10,20,30,40,50,100]" sortName="storeInId"
				    rownumbers="true" sortOrder="asc" showFooter="true">
			     <thead>
				    <tr>
					   <th field="id" width="80"  sortable="true" editor="text" hidden = "true">ID
					   </th>
					   <th field="ordId" width="80"  sortable="true" >订单id
                       </th>
					   <th field="ordCustId" width="50"  sortable="true" >客户Id
                       </th>
                       <th field="ordCustName" width="120"  sortable="true" >客户名
                       </th>
                       <th field="supId" width="80"  sortable="true" >供货商Id
                       </th>
                       <th field="supName" width="80"  sortable="true" >供货商名
                       </th>
                       <th field="ordDate" width="80"  sortable="true" >送货日期
                       </th>
					   <th field="materId" width="80"  sortable="true" >材料Id
					   </th>
					   <th field="materName" width="80"  sortable="true" >材料名
					   </th>
					   <th field="specifications" width="80"  sortable="true" >规格
					   </th>
					   <th field="brands" width="80"  sortable="true" >品牌
                       </th>
                       <th field="ordMaterWeight" width="50"  sortable="true" >数量
                       </th>
                       <th field="unit" width="40" sortable="true" >单位
                       </th>
                        <th field="ordMaterValueEvery" width="80" sortable="true" >实际单位价钱
                       </th>
                       <th field="ordMaterValue" width="80" sortable="true" >实际价钱
                       </th>
 				    </tr>
			     </thead>
			     </table>
			</td>
			</tr>
		</table>
	</body>
</html>